import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
# 对于 Selenium 4.10.0 及以上版本，可以简化写法
service = Service('./config/chromedriver.exe')  # Selenium Manager 会自动处理
driver = webdriver.Chrome(service=service)

# 或者更简单地直接（如果你的Selenium版本支持）
# driver = webdriver.Chrome()
time.sleep(2)
driver.get("https://test.topboya.com/middle/#/login")
time.sleep(10)
print(driver.title)

username = driver.find_element(By.XPATH, '//*[@id="pane-first"]/div/form/div[1]/div/div/input')
username.send_keys('16619848056')


password = driver.find_element(By.CSS_SELECTOR, '[type="password"]')
password.send_keys('a123456')

login = driver.find_element(By.CSS_SELECTOR,'.login_box_btn')
login.click()
time.sleep(10)
driver.quit()

